﻿<%@ Page Language="C#" MasterPageFile="Cliente.Master" AutoEventWireup="true" CodeBehind="tablerocliente.aspx.cs" Inherits="Smart_House_System.Cliente.tablerocliente" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
            <div style="background-image:url(../imagenes/fondo_tablero.png);" class="fondoTablero"> 
                        <asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
                            <Triggers>
                                <asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
                            </Triggers>
                            <ContentTemplate>
                                  <asp:Timer runat="server" id="UpdateTimer" interval="2000"  ontick="UpdateTimer_Tick" />
                                  <asp:Label ID="pantallaTab" runat="server" Text="Initializing..." CssClass="pantallaTab"></asp:Label>
                                    <div>
                                        <asp:Image ID="imgTick"  runat="server" CssClass="imgTick" 
                                            ImageUrl="~/Imagenes/tick_verde.jpg" />&nbsp;
                                    </div>
                                    <div>
                                        <asp:Image ID="imgCandado"  runat="server" CssClass="imgCandado" 
                                            ImageUrl="~/Imagenes/candado_verde.jpg"/>&nbsp;
                                    </div>
                                    <div>
                                        <asp:Image ID="imgTriangulo"  runat="server" CssClass="imgTriangulo" 
                                            ImageUrl="~/Imagenes/triangulo_negro.jpg" />&nbsp;
                                    </div>
                                    <div>
                                        <asp:Image ID="imgCirculo" runat="server" CssClass="imgCirculo" />&nbsp;
                                    </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <div style="margin-top: 20%;">
                            <input id="btnFleIz" type="button" value="" onclick="btnClick(this.id)" class="btnFleIz"/>
                            <input id="btnFleDe" type="button" value="" onclick="btnClick(this.id)" class="btnFleDe"/>
                            <input id="btn1" type="button" value="" onclick="btnClick(this.id)" class="btn1"/>
                            <input id="btn2" type="button" value="" onclick="btnClick(this.id)" class="btn2"/>
                            <input id="btn3" type="button" value="" onclick="btnClick(this.id)" class="btn3"/>
                            <input id="btnPerHome" type="button" value="" onclick="btnClick(this.id)" class="btnPerHome"/>
                        </div>  
                        <div style="margin-top: 1%;">
                            <input id="btnfuego" type="button" value="" onclick="btnClick(this.id)" class="btnfuego"/>
                            <input id="btn4" type="button" value="" onclick="btnClick(this.id)" class="btn4"/>
                            <input id="btn5" type="button" value="" onclick="btnClick(this.id)" class="btn5"/>
                            <input id="btn6" type="button" value="" onclick="btnClick(this.id)" class="btn6"/>
                            <input id="btnCasaVacia" type="button" value="" onclick="btnClick(this.id)" class="btnCasaVacia"/>
                        </div>
                        <div style="margin-top: 1%;">
                            <input id="btnAlerta" type="button" value="" onclick="btnClick(this.id)" class="btnAlerta"/>
                            <input id="btn7" type="button" value="" onclick="btnClick(this.id)" class="btn7"/>
                            <input id="btn8" type="button" value="" onclick="btnClick(this.id)" class="btn8"/>
                            <input id="btn9" type="button" value="" onclick="btnClick(this.id)" class="btn9"/>
                            <input id="btnCampana" type="button" value="" onclick="btnClick(this.id)" class="btnCampana"/>
                        </div>
                        <div style="margin-top: 1%;">
                            <input id="btnEscudo" type="button" value="" onclick="btnClick(this.id)" class="btnEscudo"/>
                            <input id="btnAsterisco" type="button" value="" onclick="btnClick(this.id)" class="btnAsterisco"/>
                            <input id="btn0" type="button" value="" onclick="btnClick(this.id)" class="btn0"/>
                            <input id="btnNumeral" type="button" value="" onclick="btnClick(this.id)" class="btnNumeral"/>
                            <input id="btnCirculoFlechas" type="button" value="" onclick="btnClick(this.id)" class="btnCirculoFlechas"/>
                        </div>
            </div>
            <script type="text/javascript">

                //                setInterval(function () {
                //                    getPantallaStatus();
                //                }, 1000);

                function btnClick(id) {
                    sendData(id);
                }

                function sendData(id) {
                    var dataString = "{ 'message' : '" + id + "'}";
                    $.ajax({
                        type: 'POST', //Tipo de peticiòn
                        url: 'tablerocliente.aspx/sendData', // Url y metodo que se invoca
                        data: dataString, //Necesario cuando queremos mandar algun parametro
                        contentType: 'application/json; charset=utf-8',
                        dataType: 'json', //Tipo de dato con el que se realiza la llamada
                        success: function (response) {
                            
                        }
                    });
                    return false;
                }

            </script>
</asp:Content>
